#--------------------------------------------------------------------------------
#
# Makefile for the PCAT AST generation
#
#--------------------------------------------------------------------------------

# The GC directory (the garbage collector)
#GCDIR = /public/cse/5317-501/gc

#GCC = gcc
#CFLAGS = -g
#YACC = bison
#LEX = flex

#all: parser

#parser: main.cpp ast.h pcat.o ast.o
#	$(GCC) $(CFLAGS) -I$(GCDIR) main.cpp pcat.o ast.o $(GCDIR)/gc.a -o #		parser -lstdc++

#ast.o:  ast.cpp ast.h
#	$(GCC) $(CFLAGS) -I$(GCDIR) -c ast.cpp

#pcat.c: pcat.y
#	$(YACC) -v pcat.y
#	mv pcat.tab.c pcat.c

#pcat.o: pcat.c pcat.yy.c ast.h
#	$(GCC) $(CFLAGS) -I$(GCDIR) -c pcat.c

#pcat.yy.c: pcat.lex
#	   $(LEX) pcat.lex
#	   mv lex.yy.c pcat.yy.c

#clean:
#	/bin/rm -f *.o *~ pcat.yy.c pcat.c pcat.output parser core
obj = main.o ast.o

parser : ${obj}
	 gcc -o parser ${obj} -lstdc++
  	  

main.o : main.cpp y.tab.c
	 gcc -c main.cpp

ast.o : ast.cpp ast.h
	gcc -c ast.cpp

#y.tab.o : y.tab.c ast.h lex.yy.c
#	  gcc -c y.tab.c

clean :
	rm parser ${obj}

